package com.cxyzy.masklayer;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class RecycleViewActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycleview);

        RecyclerView recyclerView = findViewById(R.id.recyclerView);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        List<String> dataList = new ArrayList();
        dataList.add("0.有效数据");
        dataList.add("1.有效数据");
        dataList.add("2.有效数据");
        dataList.add("3.有效数据");
        dataList.add("4.失效数据");
        dataList.add("5.有效数据");
        dataList.add("6.有效数据");
        dataList.add("7.失效数据");
        dataList.add("8.有效数据");
        dataList.add("9.有效数据");
        TestAdapter recycleAdapter = new TestAdapter(dataList);
        recyclerView.setAdapter(recycleAdapter);
    }
}
